load("//bzl:cpp_library.bzl", "cpp_library")
load("//bzl:cpp_unittest.bzl", "cpp_unittest")

package(default_visibility = ["//visibility:public"])

cpp_library(
    name = "mock_net_ops_dispatcher",
    hdrs = [
        "MockNetOpsDispatcher.h",
    ],
    deps = [
        "//folly/net:net_ops_dispatcher",
        "//folly/portability:gmock",
    ],
)

cpp_library(
    name = "mock_tcpinfo_dispatcher",
    hdrs = [
        "MockTcpInfoDispatcher.h",
    ],
    deps = [
        "//folly/net:tcpinfo_dispatcher",
        "//folly/portability:gmock",
    ],
)

cpp_unittest(
    name = "net_ops_test",
    srcs = ["NetOpsTest.cpp"],
    deps = [
        "//folly/net:net_ops",
        "//folly/net:network_socket",
        "//folly/portability:gtest",
        "@glog",
    ],
)

cpp_unittest(
    name = "tcpinfo_test",
    srcs = ["TcpInfoTest.cpp"],
    deps = [
        ":tcpinfo_test_util",
        "//folly/net:tcpinfo",
        "//folly/net/test:mock_net_ops_dispatcher",
        "//folly/portability:gmock",
        "//folly/portability:gtest",
    ],
)

cpp_library(
    name = "tcpinfo_test_util",
    hdrs = [
        "TcpInfoTestUtil.h",
    ],
    deps = [
        "//folly/net:tcpinfo",
        "//folly/net/test:mock_net_ops_dispatcher",
        "//folly/portability:gmock",
        "//folly/portability:gtest",
    ],
)
